(function () {
  'use strict';

  function _assertThisInitialized(e) {
    if (void 0 === e) throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
    return e;
  }
  function _callSuper(t, o, e) {
    return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, [], _getPrototypeOf(t).constructor) : o.apply(t, e));
  }
  function _classCallCheck(a, n) {
    if (!(a instanceof n)) throw new TypeError('Cannot call a class as a function');
  }
  function _construct(t, e, r) {
    if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
    var o = [null];
    o.push.apply(o, e);
    var p = new (t.bind.apply(t, o))();
    return r && _setPrototypeOf(p, r.prototype), p;
  }
  function _createClass(e, r, t) {
    return Object.defineProperty(e, 'prototype', {
      writable: false,
    }), e;
  }
  function _getPrototypeOf(t) {
    return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
      return t.__proto__ || Object.getPrototypeOf(t);
    }, _getPrototypeOf(t);
  }
  function _inherits(t, e) {
    if ('function' != typeof e && null !== e) throw new TypeError('Super expression must either be null or a function');
    t.prototype = Object.create(e && e.prototype, {
      constructor: {
        value: t,
        writable: true,
        configurable: true,
      },
    }), Object.defineProperty(t, 'prototype', {
      writable: false,
    }), e && _setPrototypeOf(t, e);
  }
  function _isNativeFunction(t) {
    try {
      return -1 !== Function.toString.call(t).indexOf('[native code]');
    } catch (n) {
      return 'function' == typeof t;
    }
  }
  function _isNativeReflectConstruct() {
    try {
      var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
    } catch (t) {}
    return (_isNativeReflectConstruct = function () {
      return !!t;
    })();
  }
  function _possibleConstructorReturn(t, e) {
    if (e && ('object' == typeof e || 'function' == typeof e)) return e;
    if (void 0 !== e) throw new TypeError('Derived constructors may only return object or undefined');
    return _assertThisInitialized(t);
  }
  function _setPrototypeOf(t, e) {
    return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
      return t.__proto__ = e, t;
    }, _setPrototypeOf(t, e);
  }
  function _wrapNativeSuper(t) {
    var r = 'function' == typeof Map ? new Map() : void 0;
    return _wrapNativeSuper = function (t) {
      if (null === t || !_isNativeFunction(t)) return t;
      if ('function' != typeof t) throw new TypeError('Super expression must either be null or a function');
      if (void 0 !== r) {
        if (r.has(t)) return r.get(t);
        r.set(t, Wrapper);
      }
      function Wrapper() {
        return _construct(t, arguments, _getPrototypeOf(this).constructor);
      }
      return Wrapper.prototype = Object.create(t.prototype, {
        constructor: {
          value: Wrapper,
          enumerable: false,
          writable: true,
          configurable: true,
        },
      }), _setPrototypeOf(Wrapper, t);
    }, _wrapNativeSuper(t);
  }

  var PageLoad = /*#__PURE__*/function (_HTMLElement) {
    function PageLoad() {
      var _this;
      _classCallCheck(this, PageLoad);
      _this = _callSuper(this, PageLoad);
      if (themeConfig.global.page_load_open) {
        var _themeConfig$global$p, _themeConfig$global$p2;
        var imgUrl = ((_themeConfig$global$p = themeConfig.global.page_load_image) === null || _themeConfig$global$p === void 0 ? void 0 : _themeConfig$global$p.src) || '';
        var imgAlt = ((_themeConfig$global$p2 = themeConfig.global.page_load_image) === null || _themeConfig$global$p2 === void 0 ? void 0 : _themeConfig$global$p2.alt) != '' ? themeConfig.global.page_load_image.alt : 'Loading Icon';
        var shadow = _this.attachShadow({
          mode: 'open',
        });
        shadow.innerHTML = '\n                <style>\n                #loading {\n                    position: fixed;\n                    left: 0;\n                    top: 0;\n                    height: 100%;\n                    width: 100%;\n                    background: #fff;\n                    z-index: 999999999;\n                    display: flex;\n                    align-items: center;\n                    justify-content: center;\n                }\n                .spinner-container {\n                    display: flex;\n                    flex-direction: column;\n                    align-items: center;\n                    justify-content: center;\n                }\n                .loading-icon {\n                    max-width: 56px;\n                    position: absolute;\n                }\n                .spinner {\n                    width: 96px;\n                    height: 96px;\n                    border: 4px solid #F6F6F6;\n                    border-top: 4px solid var(--main_button_bg);\n                    border-radius: 50%;\n                    animation: spin 1s linear infinite;\n                }\n                @keyframes spin {\n                    100% { transform: rotate(360deg); }\n                }\n                </style>\n                <div id="loading">\n                    <div class="spinner-container">\n                        '.concat(imgUrl != '' ? '<img src="'.concat(imgUrl, '" alt="').concat(imgAlt, '" class="loading-icon">') : '', '\n                        <div class="spinner"></div>\n                    </div>\n                </div>\n                \n            ');
        document.addEventListener('DOMContentLoaded', function () {
          setTimeout(function () {
            _this.remove();
          }, 1000);
        });
      } else {
        _this.remove();
      }
      return _this;
    }
    _inherits(PageLoad, _HTMLElement);
    return _createClass(PageLoad);
  }(/*#__PURE__*/_wrapNativeSuper(HTMLElement));
  customElements.define('page-load', PageLoad);

})();
